package com.ruicar.afs.cloud.image.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruicar.afs.cloud.image.condition.AuditCondition;
import com.ruicar.afs.cloud.image.condition.ImageCondition;
import com.ruicar.afs.cloud.image.entity.ComAttachmentFile;
import com.ruicar.afs.cloud.image.vo.AuditFileVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description:
 * @Author: fangchenliang
 * @Date: 2020/6/1 10:13
 */
public interface ComAttachmentFileMapper extends BaseMapper<ComAttachmentFile> {
    /**
     * @Description:
     * @Author: fangchenliang
     * @Date: 2020/6/5 14:49
     * @Param: [busiNo, busiNodes]
     * @Return: java.util.List<com.ruicar.afs.cloud.image.entity.ComAttachmentFile>
     */
    List<ComAttachmentFile> findUploadFileByBusiNo(@Param("busiNo") String busiNo, @Param("busiNodes") List busiNodes);

    List<AuditFileVo> getAuditFileVoList(@Param("query") AuditCondition auditCondition);

    List<String> getHistoryVersion(@Param("busiNo") String busiNo,@Param("busiNode") String busiNode,@Param("attachmentCode") String attachmentCode);

    /**
     * 根据场景取最新合同模板
     * @param page
     * @param affiliation
     * @return
     */
    IPage<List<ComAttachmentFile>> getComAttachMentFileByPage(Page page, @Param("query") ImageCondition affiliation);

}
